import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'

/* 首页banner-列表 */
export function getBannerList(data) {
  return request({
    url: '/jcdSys/websiteBanner/list',
    method: 'get',
    headers: encryptionData(data, '/websiteBanner/list'),
    params: data
  })
}

/* 首页banner-详情 */
export function getBannerDetail(data) {
  return request({
    url: '/jcdSys/websiteBanner/getById',
    method: 'get',
    headers: encryptionData(data, '/websiteBanner/getById'),
    params: data
  })
}

/* 首页banner-保存 */
export function saveBanner(data) {
  return request({
    url: '/jcdSys/websiteBanner/save',
    method: 'post',
    headers: encryptionData(data, '/websiteBanner/save'),
    data: Qs.stringify(data)
  })
}

/* 首页banner-删除 */
export function delBanner(data) {
  return request({
    url: '/jcdSys/websiteBanner/delete',
    method: 'DELETE',
    headers: encryptionData(data, '/websiteBanner/delete'),
    data: Qs.stringify(data)
  })
}

/* 行业资讯-列表 */
export function getNewsList(data) {
  return request({
    url: '/jcdSys/websiteResources/list',
    method: 'get',
    headers: encryptionData(data, '/websiteResources/list'),
    params: data
  })
}

/* 行业资讯-详情 */
export function getNewsDetail(data) {
  return request({
    url: '/jcdSys/websiteResources/getById',
    method: 'get',
    headers: encryptionData(data, '/websiteResources/getById'),
    params: data
  })
}

/* 行业资讯-保存 */
export function saveNews(data) {
  return request({
    url: '/jcdSys/websiteResources/save',
    method: 'post',
    headers: encryptionData(data, '/websiteResources/save'),
    data: Qs.stringify(data)
  })
}

/* 行业资讯-删除 */
export function delNews(data) {
  return request({
    url: '/jcdSys/websiteResources/delete',
    method: 'DELETE',
    headers: encryptionData(data, '/websiteResources/delete'),
    data: Qs.stringify(data)
  })
}

/* 行业资讯-状态修改 开启/关闭头条 */
export function updNewsStatus(data) {
  return request({
    url: '/jcdSys/websiteResources/updateHeadline',
    method: 'post',
    headers: encryptionData(data, '/websiteResources/updateHeadline'),
    data: Qs.stringify(data)
  })
}

